package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.annotation.UserParams;
import cn.wolfcode.wolf2w.domain.StrategyComment;
import cn.wolfcode.wolf2w.domain.UserInfo;
import cn.wolfcode.wolf2w.query.StrategyCommentQuery;
import cn.wolfcode.wolf2w.service.IStrategyCommentService;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * Created by 甘静斌 on 2020-08-11 21:19
 */
@RestController
@RequestMapping("strategyComments")
public class StrategyCommentController {
    
    @Autowired
    private IStrategyCommentService strategyCommentService;
    

    @GetMapping("/query")
    public Object query(StrategyCommentQuery qo){

        Page<StrategyComment> page = strategyCommentService.query(qo);
        return JsonResult.success(page);
    }


    /**
     * 用户注入对象 ,演示是否正确
     * @param userInfo
     * @return
     */
    @GetMapping("/info")
    public Object info(@UserParams UserInfo userInfo){
        return JsonResult.success(userInfo);
    }

    
}
